<link rel="stylesheet" href="/static/admin/css/auth.css?v={$version}">

<div id="app">
    <div class="app-left">
        <div class="layui-card">
            <div class="layui-card-body">
                <div class="layui-btn-group">
                    <button type="button" data-type="1" data-url="{:url('admin/system.menu/add')}" class="layui-btn layui-btn-xs actionBtn">
                        <i class="layui-icon layui-icon-addition"></i>
                        添加菜单
                    </button>

                    <a  data-url="{:url('admin/system.menu/importmenu')}" class="layui-btn layui-btn-xs ref-node">
                        <i class="layui-icon  layui-icon-release"></i>
                        导入菜单
                    </a>

                    <a data-url="{:url('admin/system.menu/refmenu')}" class="layui-btn layui-btn-xs ref-node">
                        <i class="layui-icon layui-icon-refresh "></i>
                        刷新菜单
                    </a>
                    <!--<button type="button" data-type="2" data-url="{:url('admin/system.menu/delmenu')}" class="layui-btn layui-btn-xs layui-btn-danger actionBtn">
                        <i class="layui-icon">&#xe640;</i>
                        删除菜单
                    </button>-->
                </div>
                <hr class="layui-border-blue">
            </div>
            <div class="layui-card-body">
                <ul id="MenuTree" class="ztree"></ul>
            </div>
        </div>
    </div>
    <div class="app-right" style="display: none">
        <div class="layui-card">
            <div class="layui-card-body">
                <iframe src="" frameborder="0" class="loadHtml"></iframe>
            </div>
        </div>
    </div>
</div>

<style type="text/css">
    .app-left{
        width:300px;
        margin-right: 15px;
        float: left;
    }
    .app-right{
        float: right;
        width: calc(100% - 315px);
    }
    .loadHtml{
        width: 100%;
        height:600px;
    }
    #MenuTree{
        padding: 0;
    }
</style>

<div class="layui-card" style="display: none">
    <div class="layui-card-body">
        <div>
            <form action=""  class="layui-form">
                <div class="layui-form-item">
                    <div class="layui-input-inline">
                        <input type="text" name="keywords" value="{$search.keywords|default=''}" class="layui-input" placeholder="菜单名称">
                    </div>
                    <div class="layui-input-inline">
                        <button class="layui-btn" lay-submit lay-filter="formDemo">搜索</button>
                        {if isset($search.keywords)}
                        <a href="javascript:history.go(-1);" class="layui-btn">返回</a>
                        {/if}
                    </div>
                </div>
            </form>

            <form action="{:url('admin/system.menu/delmenu')}" method="post" class="layui-form delete-form" id="cp-form">
                <div class="layui-btn-group">
                    <a href="{:url('admin/system.menu/add')}" class="layui-btn layui-btn-xs">
                        <i class="layui-icon layui-icon-addition"></i>
                        添加菜单
                    </a>

                    <a  data-url="{:url('admin/system.menu/importmenu')}" class="layui-btn layui-btn-xs ref-node">
                        <i class="layui-icon  layui-icon-release"></i>
                        导入菜单
                    </a>

                    <a data-url="{:url('admin/system.menu/refmenu')}" class="layui-btn layui-btn-xs ref-node">
                        <i class="layui-icon layui-icon-refresh "></i>
                        刷新菜单
                    </a>

                    <button data-url="{:url('admin/system.menu/delmenu')}" class="layui-btn layui-btn-xs layui-btn-danger clearExceptionNode">
                        <i class="layui-icon">&#xe640;</i>
                        删除菜单
                    </button>
                </div>
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th width="10">
                            <input type="checkbox" class="layui-input"  lay-skin="primary" lay-filter="select-all">
                        </th>
                        <th width="40">状态</th>
                        <th width="60">是否视图</th>
                        <th width="120">操作</th>
                        <th width="120">名称</th>
                        <th>链接</th>
                    </tr>
                    </thead>
                    <tbody>
                    {volist name="menuList" id='v'}
                    <tr>
                        <td align="center" valign="middle">
                            <input type="checkbox" name="idList[]" class="layui-input" lay-skin="primary" value="{$v.id}">
                        </td>
                        <td align="center" valign="middle">
                            {switch name="$v.status"}
                            {case value="1"}
                            <span class="layui-badge layui-bg-green">正常</span>
                            {/case}
                            {default/}
                            <span class="layui-badge">异常</span>
                            {/switch}
                        </td>
                        <td align="center" valign="middle">
                            {switch name="$v.is_view"}
                            {case value="1"}
                            <span class="layui-badge layui-bg-green">是</span>
                            {/case}
                            {default/}
                            <span class="layui-badge">否</span>
                            {/switch}
                        </td>
                        <td>
                            <a href="{:url('admin/system.menu/savemenu',['id'=>$v['id']])}" class="layui-btn layui-btn-xs layui-btn-danger clearExceptionNode">
                                <i class="layui-icon layui-icon-edit"></i>
                                编辑
                            </a>
                        </td>
                        <td>
                            <p class="nodeTitle">{$v.title}</p>
                        </td>
                        <td>{$v.name}</td>
                    </tr>
                    {/volist}
                    </tbody>
                </table>
            </form>
            {$menuList|raw}
        </div>
    </div>
</div>